﻿
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="Description" content="Cynthia项目缺陷管理系统，拥有表单流程化设计，可视化拖动布局等功能，提供项目管理，缺陷管理，，统计，查询等服务，是您项目上的好帮手！">
<meta name="Keywords" content="Cynthia,BUG管理,项目管理 ,缺陷管理,任务管理,BUG,缺陷,开源">
<link href="../lib/bootstrap2/css/bootstrap.min.css" rel="stylesheet" type="text/css">
<link href="../lib/bootstrap2/css/bootstrap-responsive.min.css" rel="stylesheet" type="text/css">
<link href="../lib/g_bootstrap/css/google-bootstrap.css" rel="stylesheet" type="text/css">

<link type="text/css" href="../css/flow_svg.css" rel="stylesheet" />
<link href="../css/top.css" rel="stylesheet" type="text/css">
<link href='../lib/select2/select2.css' rel="stylesheet" style="text/css">

<script type="text/javascript" src="../lib/svg/raphael-min.js"></script>
<script type="text/javascript" src="../lib/jquery/jquery-1.9.3.min.js"></script>
<script type="text/javascript" src='../lib/bootstrap2/js/bootstrap.cynthia.min.js'></script>
<script type="text/javascript" src="../lib/select2/select2.js"></script>
<script type="text/javascript" src="../lib/svg/flow.js"></script>
<script type="text/javascript" src="../lib/svg/flow.jpdl4.js"></script>
<script type="text/javascript" src="../lib/svg/raphael.pan-zoom.js"></script>
<script type="text/javascript" src='../lib/select2/select2.js'></script>
<script type="text/javascript" src="../js/util.js"></script>
<script type="text/javascript" src="../js/admin/admin_flow_edit.js"></script>


</head>
<body>
<div id ="header-nav">
</div>
<div style="margin-left:10px;margin-top:45px;"><!--最外层容器-->
	<div class="type_change">
		<div class="pull-left  active" value="chart">图型版</div>
		<div class="pull-left" value="word">文字版</div>
	</div>	
</div>

<div>
	<div class="tab-panel" id="chart"><!--图型版-->
		  <div class="pull-left">
			  <div id="myflow_tools" class="ui-widget-content">
		  		 <div id="myflow_tools_handle" style="text-align: center;" class="ui-widget-header">工具集</div>
				 <div class="node selectable" id="myflow_save"><img src="../images/svg_img/save.gif" />&nbsp;&nbsp;保存</div>
				 <div class="node selectable" id="myflow_edit"><img src="../images/svg_img/settings.png" />&nbsp;&nbsp;编辑</div>
				 <div class="node selectable" id="myflow_delete"><img src="../images/svg_img/48/end_event_cancel.png"/>&nbsp;&nbsp;删除</div>
				 <div class="node selectable" id="pointer"><img src="../images/svg_img/select16.gif" />&nbsp;&nbsp;选择</div>
				 <div class="node selectable" id="path"><img src="../images/svg_img/48/flow_sequence.png" />&nbsp;&nbsp;动作</div>
				 <div class="node selectable" id="state"><img src="../images/svg_img/48/task_empty.png" style="height:12px;margin-top:-2px;"/>&nbsp;&nbsp;状态</div>
			</div>
			
			<div style="float:left;height:720px;">
			    <div id ="mapContainer">
			    	<div id="myflow"></div>
			    	<div id="mapControls"><a id="up" href="javascript:;"></a><a id="down" href="javascript:;"></a></div>
			    	<div id="search">
						<div class="input-prepend">
						  <input class="span2" id="searchValue" type="text" placeholder='search'/>
						  <select id="searchType" class='select span1 noSearch'>
						  	<option id='stat' value='stat'>状态</option>
						  	<option id='action' value='action'>动作</option>
						  </select>
						</div>
					</div>
			    	 
			    	<div id="flowNormalAction">
						<a id="edit" href="javascript:;"></a>
						<a id="look" href="javascript:;"></a>
						<a id="del" href="javascript:;"></a>
					</div>
			    </div>
			  </div>
			  
			</div>
	</div>
	
	
	<div class="tab-panel" id="word" style="display:none;"><!--文字版-->
		<div class="container-fluid">
			<div class="row-fluid">
				<div class="span12 template_toolbar">
					<button class="btn btn-danger btn-create" type="button" onclick="creatWordAction();">新建动作</button>
				</div>
			</div>
			<div class="row-fluid">
				<div class="span12">
					<table class="table table-hover table-condensed">
						<thead>
				    		<tr>
				    			<th>序号</th><th>初始状态</th><th>动作</th><th>结束状态</th><th>删除</th>
				    		</tr>
				    	</thead>
				    	<tbody id ="wordActionTable">
				    	</tbody>
					</table>
				</div>
			</div>
		</div>
		
		<!-- 文字版创建动作 -->
		<div id="cfgWordActionDiv" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="tag modal" aria-hidden="true">
			  <div class="modal-header">
			    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
			    <div>
			    	<h5>新建动作</h5>
			    </div>
			  </div>
			  <div class="modal-body">
			  	<form class="form-inline">
			  		<label>动作名称：</label>
			  		<input type="text" id='wordActionName' placeholder="动作名">
			  		<input type="hidden" id='actionId'>
			  	</form>
			  	
			  	<form class="form-inline">
			  		<label>初始状态：</label>
			  		<select class="span3" id="actionFromId">
			  		
			  		</select>
			  		<label class="label label-important">不选则为开始状态</label>
			  	</form>
			  	
			  	<form class="form-inline">
			  		<label>结束状态：</label>
			  		<select class="span3" id="actionToId">
			  		
			  		</select>
			  	</form>
			  	
			  	<form class="form-inline">
			  		<label>动作角色：</label>
			  		<div id="wordActionRoleDiv" style="display:inline">
	  				</div>
			  	</form>
			  	<hr />
			  	<div class="row-fluid">
					<div class="span12 template_toolbar">
						<button class="btn btn-danger btn-create" data-toggle='modal' onclick="creatWordStat();">新建状态</button>
					</div>
				</div>
			  </div>
			  
			  <div class="modal-footer">
			    <button class="btn" data-dismiss="modal" aria-hidden="true">关闭</button>
			    <button class="btn btn-primary" onclick="addWordAction()">确定</button>
			  </div>
		</div>
	
	
	</div>
</div>



<!-- 添加状态 -->
<div id="cfgStateDiv" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="tag modal" aria-hidden="true">
  <div class="modal-header">
    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
    <div>
    	<h5 id="myModalStateTag">新建状态</h5>
    </div>
  </div>
  <div class="modal-body">
  	<form class="form-inline">
  		<label>状态名称：</label>
  		<input type="text" id='statName' placeholder="状态名">
  		<input type="hidden" id='statId'>
  		<input type="hidden" id='mouse_x'>
  		<input type="hidden" id='mouse_y'>
  	</form>
  </div>
  <div class="modal-footer">
    <button class="btn" data-dismiss="modal" aria-hidden="true">关闭</button>
    <button class="btn btn-primary" onclick="addOrModifyStat()">确定</button>
  </div>
</div>


<!-- 添加动作 -->
<div id="cfgActionDiv" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="tag modal" aria-hidden="true">
  <div class="modal-header">
    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
    <div>
    	<h5 id="myModalActionTag">新建动作</h5>
    </div>
  </div>
  <div class="modal-body">
  	<form class="form-inline">
  		<label>动作名称：</label>
  		<input type="text" id='actionName' placeholder="动作名">
  		<input type="hidden" id='actionId'>
  	</form>
  	
  	<form class="form-inline">
  		<label>开始状态：</label>
  		<select id="beginStatId" class="stat noSearch">
  		</select>
  	</form>
  	
  	<form class="form-inline">
  		<label>结束状态：</label>
  		<select id="endStatId" class="stat noSearch">
  		</select>
  	</form>
  	
  	<form class="form-inline">
  		<label>动作角色：</label>
  		<div id="actionRoleDiv" style="display:inline">
  		</div>
  	</form>
  	
  	<hr />
  	<div class="row-fluid">
		<div class="span12 template_toolbar">
			<button class="btn btn-danger btn-create pro_involved_false" data-toggle='modal' data-target="#addRoleDiv">新建角色</button>
			<button class="btn btn-link" data-toggle='modal' id="action_high_btn">高级配置</button>
		</div>
		<div class="span12 action_high_right" style="disply:none;">
		<hr/>
			<form class="form-inline">
		  		<label>是否允许指派多人：</label>
		  		<input type="radio" name="assignToMore" value="true">&nbsp;是 &nbsp;&nbsp;<input type="radio" name="assignToMore" value="false" checked="checked">&nbsp;否
	  		</form>
		<hr/>
		</div>
	</div>
  	
  </div>
  <div class="modal-footer">
    <button class="btn" data-dismiss="modal" aria-hidden="true" onclick="cacelModifyAction();">关闭</button>
    <button class="btn btn-primary" onclick="addOrModifyAction()">确定</button>
  </div>
</div>




<!-- 新建角色 -->
<div id="addRoleDiv" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="tag modal" aria-hidden="true">
  <div class="modal-header">
    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
    <h5>新建角色</h5>
  </div>
  <div class="modal-body">
  	<form class="form-inline">
	    <label>角色名称：</label>
	   	<input type="text" id="role_name" />
  	</form>
  </div>
  <div class="modal-footer">
    <button class="btn" data-dismiss="modal" aria-hidden="true">关闭</button>
    <button class="btn btn-primary" onclick="addRole()">添加</button>
  </div>
</div>


<!-- 编辑角色用户-->
<div id="modifyUserDiv" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="tag modal" aria-hidden="true">
  <div class="modal-header">
    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
    <h5 id="myModalLabel">编辑角色用户</h5>
  </div>
  <div class="modal-body">
    <button class="btn btn-danger" data-toggle="modal" data-target='#addUserDiv'>新建用户</button>
    <div class="divider"></div>
  	<table class="table table-hover table-condensed">
    	<thead>
    		<tr><th>序号</th><th>用户名</th><th>具备角色</th></tr>
    	</thead>
    	<tbody id="user-cfg-table">
    	
    	</tbody>
    </table>
    <input type="hidden" id="role_id"/>
  </div>
  <div class="modal-footer">
    <button class="btn" data-dismiss="modal" aria-hidden="true">关闭</button>
    <button class="btn btn-primary" onclick="modifyRoleUser()">保存</button>
  </div>
</div>

<!-- hidden -->
<input type="hidden" id ="flowId" value="717213"/>
</body>
</html>